//
//  UIBarButtonItem+SaBarButton.m
//  SaaS
//
//  Created by 迟建国 on 2018/12/24.
//  Copyright © 2018 SA. All rights reserved.
//

#import "UIBarButtonItem+SaBarButton.h"

@implementation UIBarButtonItem (SaBarButton)
+ (instancetype)itemWithImage:(NSString *)image heightImage:(NSString *)heightImage target:(id)target action:(SEL)action
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setBackgroundImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [btn setBackgroundImage:[UIImage imageNamed:heightImage] forState:UIControlStateHighlighted];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    btn.ce_size = btn.currentBackgroundImage.size;
    return [[self alloc] initWithCustomView:btn];
}
@end
